<template>
<div>

  <el-menu
      style="width: 200px;min-height: calc(100vh - 50px)"
      default-active="person"
      router
      class="el-menu-vertical-demo"
  >
    <el-sub-menu index="admin" v-if="user.age===3" >
      <template #title>
        <span>管理员账号</span>
      </template>
        <el-menu-item index="user" :route="{path:'/'}">全部信息</el-menu-item>
      </el-sub-menu>
<!--    </el-sub-menu>-->
    <el-menu-item index="book" v-if="user.age!==3" >
     选课管理
    </el-menu-item>

    <el-menu-item index="score" v-if="user.age!==3" >
      成绩管理
    </el-menu-item>

    <el-menu-item index="course" v-if="user.age!==3" >
      课程表
    </el-menu-item>

    <el-menu-item index="person">
      个人信息
    </el-menu-item>




  </el-menu>


</div>
</template>

<script>
export default {
  name: "Aside",
  data(){
    return{
      user:{},
      path:this.$router.path
    }
  },
  created() {
    let userStr=sessionStorage.getItem("user")||"{}"
    this.user=JSON.parse(userStr)

  }
}

</script>

<style scoped>

</style>